package com.rcadmin.busi.logview.action;

import java.io.IOException;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.rcadmin.busi.logview.service.ResourceService;
import com.rcadmin.common.bean.TreeObject;
import com.rcadmin.common.exception.BusiException;

/**
 * 日志接口类
 * 
 * @author tanson lam
 * @create 2016年9月6日
 */
@RestController
@EnableAutoConfiguration
public class LogViewRest {
	@Resource
	private ResourceService logViewService;

	/**
	 * 获取分类的树结构
	 * 
	 * @throws BusiException
	 * @throws IOException
	 */
	 
	@RequestMapping(value = "/viewLogTree.op", method = RequestMethod.POST)
	@ResponseBody
	public List<TreeObject> viewLogTree(Integer projectId)
			throws BusiException, IOException {
		List<TreeObject> categoryList = logViewService
				.getProjectFileTree(projectId);
		return categoryList;
	}

}
